<?php
//mod 1403
//1404
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
	/**
     * Add the config to the registry
     */

	protected function _initDB() {
       $parameters  = array(
               'host' => 'localhost',
               'username' => 'root',
               'password' =>'feveryou',
               'dbname' =>'whatever'
       );
       try {
               $db = Zend_Db::factory('Pdo_Mysql', $parameters );
               $db->getConnection();
       } catch (Zend_Db_Adapter_Exception $e) {
               echo $e->getMessage();
               die('Could not connect to database.');
       } catch (Zend_Exception $e) {
               echo $e->getMessage();
               die('Could not connect to database.');
       }
       Zend_Registry::set('db', $db);
       Zend_Db_Table_Abstract::setDefaultAdapter($db);
	}

    protected function _initAutoload() {
        $moduleLoader = new Zend_Application_Module_Autoloader(array(
            'namespace' => '', 
            'basePath'  => APPLICATION_PATH));
        return $moduleLoader;
        
    }
//    protected function _initViewHelpers(){
//         /* Initialize action controller here */
//        //init the ZendX JQuery Helper
//        $view = new Zend_View();
//        $view->addHelperPath(
//                'ZendX/JQuery/View/Helper/',
//                   'ZendX_JQuery_View_Helper');
//                // action body
//        $emt=new ZendX_JQuery_Form_Element_AutoComplete('ac',array('label' => 'Search'));
//        $emt->setJQueryParam('source','/search/hac');
//        $view->autocompleteElement=$emt;
//
//    }
//    protected function _initView(){
//        $view = new Zend_View();
//        $view->headMeta()->appendHttpEquiv('Content-Type',
//                                            'text/html; charset=utf-8');
////        ZendX_Jquery::enableView($view);
//        $view->addHelperPath(
//                'ZendX/JQuery/View/Helper/',
//                   'ZendX_JQuery_View_Helper');
//                // action body
//        $emt=new ZendX_JQuery_Form_Element_AutoComplete('ac',array('label' => 'Search'));
////        $emt->setJQueryParam('source','/search/hac');
//        $emt->setJQueryParam('data',array("jerry",'zhongshan'));
//        $view->autocompleteElement=$emt;
//        return $view;
//
//    }


}

